#include "log/log.h"
#include <string.h>
#include "app_runner.h"
#include "ota_version.h"
#include "daemon_runner.h"

int main(int argc, char *argv[])
{
    if (argc == 1) {
        log_error("必须携带参数（app|ota|daemon/version）");
        return -1;
    }
    if (strcmp(argv[1], "app") == 0) {
        app_runner_run();
    } else if (strcmp(argv[1], "ota") == 0) {
        ota_version_checkUpdateDialy();
    } else if (strcmp(argv[1], "daemon") == 0) {
        daemon_runner_run();
    } else if (strcmp(argv[1], "version") == 0) {
        ota_version_printVersion();
    }  else {
        log_error("参数只支持：app|ota|daemon|version");
        return -1;
    }
    return 0;
}
// 测试运行
// gateway_test app 
// gateway_test ota 
// gateway_test daemon 
// gateway_test version